/**
 * 用户相关请求模块
 */

import request from 'utils/request'
import * as type from '@/types'
import { getItem } from '@/store/store'


const user = getItem("user")

console.log(user)

export const Login = (data:type.Login) => {
    return request ({ 
        url:"/app/v1_0/authorizations",
        method:"POST",
        data
    })
}

export const sendSMS = (mobile:string) => {
    return request ({
        url:`/app/v1_0/sms/codes/${mobile}`,
        method:"GET"
    })
}

export const getCurrentUser = () => {
    return request ({
        url:"/app/v1_0/user",
        method:"GET"
    })
}

export const getUserChannels = () => {
    return request ({
        url:"/app/v1_0/user/channels",
        method:"GET"
    })
}